From 4450aba6c077be9591324f669d27cb1abbcbc576 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 1 Nov 2023 00:03:06 +0100 Subject: [PATCH] Patch up t2h for texinfo 7.1 This is not perfect, but the results looks okay and makes the build pass. Gbp-Pq: Name 0005-Patch-up-t2h-for-texinfo-7.1.patch --- doc/t2h.pm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/t2h.pm b/doc/t2h.pm index d07d9742..5e32f3aa 100644 --- a/doc/t2h.pm +++ b/doc/t2h.pm @@ -21,7 +21,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # no navigation elements -set_from_init_file('HEADERS', 0); +texinfo_set_from_init_file('HEADERS', 0); sub ffmpeg_heading_command($$$$$) { @@ -112,8 +112,8 @@ sub ffmpeg_heading_command($$$$$) $cmdname = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level]; } - $result .= &{$self->{'format_heading_text'}}( - $self, $cmdname, $heading, + $result .= &{$self->formatting_function('format_heading_text')}( + $self, $cmdname, [$heading], $heading_level + $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command); } @@ -127,22 +127,22 @@ foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') { } # determine if texinfo is at least version 6.8 -my $program_version_num = version->declare(get_conf('PACKAGE_VERSION'))->numify; +my $program_version_num = version->declare(texinfo_get_conf('PACKAGE_VERSION'))->numify; my $program_version_6_8 = $program_version_num >= 6.008000; # print the TOC where @contents is used if ($program_version_6_8) { - set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline'); + texinfo_set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline'); } else { - set_from_init_file('INLINE_CONTENTS', 1); + texinfo_set_from_init_file('INLINE_CONTENTS', 1); } # make chapters

-set_from_init_file('CHAPTER_HEADER_LEVEL', 2); +texinfo_set_from_init_file('CHAPTER_HEADER_LEVEL', 2); # Do not add
-set_from_init_file('DEFAULT_RULE', ''); -set_from_init_file('BIG_RULE', ''); +texinfo_set_from_init_file('DEFAULT_RULE', ''); +texinfo_set_from_init_file('BIG_RULE', ''); # Customized file beginning sub ffmpeg_begin_file($$$) @@ -193,7 +193,7 @@ EOT return $head1 . $head_title . $head2 . $head_title . $head3; } if ($program_version_6_8) { - texinfo_register_formatting_function('format_begin_file', \&ffmpeg_begin_file); + # texinfo_register_formatting_function('format_begin_file', \&ffmpeg_begin_file); } else { texinfo_register_formatting_function('begin_file', \&ffmpeg_begin_file); } @@ -223,7 +223,7 @@ if ($program_version_6_8) { sub ffmpeg_end_file($) { my $self = shift; - my $program_string = &{$self->{'format_program_string'}}($self); + my $program_string = &{$self->formatting_function('format_program_string')}($self); my $program_text = < $program_string @@ -244,7 +244,7 @@ if ($program_version_6_8) { # Dummy title command # Ignore title. Title is handled through ffmpeg_begin_file(). -set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1); +texinfo_set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1); sub ffmpeg_title($$$$) { return ''; @@ -262,7 +262,7 @@ sub ffmpeg_float($$$$$) my $args = shift; my $content = shift; - my ($caption, $prepended) = Texinfo::Common::float_name_caption($self, + my ($caption, $prepended) = Texinfo::Convert::Converter::float_name_caption($self, $command); my $caption_text = ''; my $prepended_text; @@ -335,7 +335,7 @@ sub ffmpeg_float($$$$$) $caption->{'args'}->[0], 'float caption'); } if ($prepended_text.$caption_text ne '') { - $prepended_text = $self->_attribute_class('div','float-caption'). '>' + $prepended_text = $self->html_attribute_class('div',['float-caption']). '>' . $prepended_text; $caption_text .= ''; } @@ -349,7 +349,7 @@ sub ffmpeg_float($$$$$) $prepended_text = ''; $caption_text = ''; } - return $self->_attribute_class('div', $html_class). '>' . "\n" . + return $self->html_attribute_class('div', [$html_class]). '>' . "\n" . $prepended_text . $caption_text . $content . ''; } -- 2.30.2